<template>
  <div>
    <FormTable :formData="formData"
               :columnData="columnData"
               :url="$api.unipush_getCidUserList"
               :editData="editData"
               :new_url="this.$api.unipush_insert"
               :detail_url="this.$api.product_type_info"
               :edit_url="this.$api.product_type_save"
               :is_default_edit="true"
               label-width="140px"
               :pageConfig="pageConfig"></FormTable>
  </div>
</template>

<script>
export default {
  data () {
    return {
      formData: [
        {
          name: "title",
          label: "推送任务标题",
          value: "",
          type: "input",
        },
        {
          name: "display",
          label: "是否显示",
          value: '',
          type: "select",
          groups: [
            {
              label: '所有',
              value: ''
            },
            {
              label: '显示',
              value: 1
            },
            {
              label: '隐藏',
              value: 0
            },
          ]
        },
        {
          name: "start_time",
          label: "开始时间",
          value: '',
          type: "date_time_picker",
          config: {
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            'value-format': 'yyyy-MM-dd HH:mm:ss',
          },
        },
        {
          name: "end_time",
          label: "结束时间",
          value: '',
          type: "date_time_picker",
          config: {
            type: 'datetime',
            format: 'yyyy-MM-dd HH:mm:ss',
            'value-format': 'yyyy-MM-dd HH:mm:ss',
          },
        },
      ],
      columnData: [
        {
          prop: "mobile",
          label: "手机号码"
        },
        {
          prop: "qd",
          label: "渠道",
        },
        {
          prop: "openid",
          label: "openid"
        },
        {
          prop: "unionid",
          label: "unionid"
        },

        {
          prop: "cid",
          label: "设备唯一标识"
        },
        {
          prop: "score",
          label: "积分",
        },
        {
          prop: "isNew",
          label: "是否新用户"
        },
        {
          prop: "nickName",
          label: "昵称",
        },
        {
          prop: "avatarUrl",
          label: "头像地址",
          custom:true,
          type:'icon'
        },
        
        {
          prop: "savings",
          label: "节省金额"
        },
        {
          prop: "rights_time",
          label: "权益过期时间",
        },
        // {
        //   prop: 'btn_group',
        //   label: '操作',
        //   custom: true,
        //   type: 'btn_group',
        //   width: '200px',
        //   group: [
        //     {
        //       name: '编辑',
        //       type: 'edit',
        //       color: 'primary',
        //       detail_mark: 'product_type_id',
        //     },
        //     {
        //       name: '删除',
        //       type: 'delete',
        //       color: 'danger',
        //       url: this.$api.product_type_status
        //     }
        //   ]
        // }
      ],
      editData: [
        {
          name: "product_type_id",
          label: "权益会员类型id",
          value: "",
          type: "input",
          display: 'none'
        },
        {
          name: "rights_id",
          label: "会员类型",
          value: "",
          type: "select",
          groups: [],
          config: {
            filterable: true
          },
          rules: [
            { required: true, message: "请选择会员类型", trigger: "blur" },
          ]
        },
        {
          name: "name",
          label: "会员类型名称",
          value: "",
          type: "input",
          rules: [
            { required: true, message: "请输入会员类型", trigger: "blur" },
          ]
        },
        {
          name: "sort",
          label: "排序",
          value: "",
          type: "input",
        },
        {
          name: "display",
          label: "是否显示",
          value: '',
          type: "select",
          groups: [
            {
              label: '显示',
              value: '1'
            },
            {
              label: '隐藏',
              value: '0'
            },
          ]
        },
      ],
      pageConfig: {
        page: 1,
        pagesize: 10,
      }
    };
  },
  created () {
  },
  methods: {
    handleSizeChange (e) {
      console.log(e);
    },
    handleCurrentChange (e) {
      console.log(e);
    },
    submit (e) {
      console.log(e);
    },
    reset (e) {
      console.log(e);
    }
  }
}
</script>

<style lang="scss" scoped>
</style>